import axios from '@/plugins/axios'
class api {
    async login(data) {
        return axios
            .post('/auth/login', data)
            .then(res => res)
    }
    async outLogin(data) {
        return axios
            .post('/outLogin', data)
            .then(res => res)
    }
    async getUserInfo(data) {
        return await axios
            .get('/users/userInfo', {
                params: data
            })
            .then(res => res)
    }
    async addUser(data) {
        return await axios
            .post('/addUser', data)
            .then(res => res)
    }
    async navList(data) {
        return await axios
            .get('/nav/navList', {
                params: data
            })
            .then(res => res)
    }
    async getMenu(data) {
        return await axios
            .get('/nav/getMenu', {
                params: data
            })
            .then(res => res)
    }
    async addNav(data) {
        return await axios
            .post('/nav/addNav', data)
            .then(res => res)
    }
    async delBucket(data) {
        return await axios
            .delete('/autoDesk/delBucket', {
                params: data
            })
            .then(res => res)
    }
    async addBuckets(data) {
        return await axios
            .post('/autoDesk/addBuckets', data)
            .then(res => res)
    }
    async getCheckBuckets(data) {
        return await axios
            .get('/autoDesk/checkBuckets', {
                params: data
            })
            .then(res => res)
    }
    async getAuthorizationUrl(data) {
        return await axios
            .get('/autoDesk/getAuthorizationUrl', {
                params: data
            })
            .then(res => res)
    }
    async getViewerToken(data) {
        return await axios
            .get('/autoDesk/getViewerToken', {
                params: data
            })
            .then(res => res)
    }
    async autoCadLogin(data) {
        return await axios
            .get('/autoDesk/autoCadLogin', {
                params: data
            })
            .then(res => res)
    }
    async authCadcallback(data) {
        return await axios
            .get('/autoDesk/authCadcallback', {
                params: data
            })
            .then(res => res)
    }
    async autodeskAuthLogin() {
        return await axios
            .get('/autoDesk/login', {
                withCredentials: true, // 关键配置
            })
            .then(res => res)
    }
    async getCheckBucketDetail(data) {
        return await axios
            .get('/autoDesk/checkBucketDetail', {
                withCredentials: true, // 关键配置
                params: data
            })
            .then(res => res)
    }
    async authProfile(data) {
        return await axios
            .get('/autoDesk/authProfile', {
                withCredentials: true, // 关键配置
                params: data
            })
            .then(res => res)
    }
    async getObjects(data) {
        return await axios
            .get('/autoDesk/getObjects', {
                params: data
            })
            .then(res => res)
    }
    async getMetadata(data) {
        return await axios
            .post('/autoDesk/getMetadata', data)
            .then(res => res)
    }
    async getForModelGuid(data) {
        return await axios
            .post('/autoDesk/getForModelGuid', data)
            .then(res => res)
    }
    async getProperties(data) {
        return await axios
            .post('/autoDesk/getProperties', data)
            .then(res => res)
    }
     async postProperties(data) {
        return await axios
            .post('/autoDesk/postProperties', data)
            .then(res => res)
    }
    async getUrnStatus(data) {
        return await axios
            .get(`/autoDesk/models/${data.urn}/status`, data)
            .then(res => res)
    }
    async getOCRData(data) {
        return await axios
            .post('/user/getOCR', data)
            .then(res => res)
    }
    async getDataFords(data) {
        return await axios({
            method: 'post',
            url: '/ds/deepseek',
            data: data
        }).then(res => res)
    }

    async aiGenerate(data) {
        return await axios
            .post('/generate', data)
            .then(res => res)
    }
}

export default new api()
